<?php

namespace App\Admin\Actions\Grid\Row\SwtProcurement;

use App\Admin\Forms\EmployeeDetailForm;
use Dcat\Admin\Grid\RowAction;
use Dcat\Admin\Widgets\Modal;

class EmployeeDetail extends RowAction
{
    /**
     * @return string
     */
    protected $title = '员工详情';


    public function render()
    {
        $title = '员工详情 - '. $this->row->id;

        $form = EmployeeDetailForm::make()->payload(['id' => $this->getKey()]);

        $button = <<<HTML
            <a><i class="feather icon-eye text-success"></i> <span class="text-success">{$this -> title}</span> &emsp;</a>
        HTML;

        $id = $this->getKey();

        return Modal::make()
            ->lg()
            ->title($title)
            ->body($form)
            ->button($button);
    }

}
